﻿<!DOCTYPE html>

@using BnbjoyBackend.Site.Extends;
@using BnbjoyBackend.Site.ConstantsNS;
@using Bnbjoy.Business.Model.Dashboard;

@model Bnbjoy.Business.Model.Dashboard.HeadInfoResponse
@{
    string[] authKeys = Constants.AuthKeys.Split(',');
    string[] authValues = Constants.AuthValues.Split(','); 
    string[] authUrls = Constants.AuthUrls.Split(',');
    string[] mainNavUrls = Constants.MainNavUrls.Split(',');
    HeadInfoResponse headInfoObj = Session[Constants.DashboardHeadInfo] as HeadInfoResponse;
}

<html>
<head>
    <meta charset="UTF-8">
    <meta>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="~/Content/bootstrap.min.css" media="screen">
    <link rel="stylesheet" href="~/Content/bootstrap-dialog.min.css" media="screen">
    <link rel="stylesheet" href="~/Content/show-loading.css">
    <link rel="stylesheet" href="~/Content/jedate.css">
    <link rel="stylesheet" href="~/Content/main.css">

    <style>
        body {
            background: rgba(219, 222, 224, 0.4);
            overflow: hidden;
        }
    </style>
    <base href="@Request.GetBaseUrl()" />
    <title>@ViewBag.Title</title>
</head>
<body id="loading">
    <div class="dashboard">
        <div class="navHeader">
            <div class="header">
                <div class="brand">宿说掌柜</div>
                <div class="bnbName">@headInfoObj.BnbName</div><span id="spe">|</span>

                @if (headInfoObj.OnlineSale)
                {
                    <div class="onsale">已开启线上销售</div>
                    <button id="disableOnsale">关闭</button>
                }
                else
                {
                    <div class="onsale">未开启线上销售</div>
                    <button id="enableOnsale">开启</button>
                }

                <div class="contactus">
                    <span></span>
                    <a href="javascript:void(0)">联系我们</a>
                </div>
                <div class="message">
                    <span></span>
                    <a href="javascript:void(0)">消息</a>
                </div>
                <div class="logininfo">
                    <p>Hi,@headInfoObj.UserName</p>
                    <a href="javascript:void(0)">退出</a><p>|</p><p>
                    </p>
                </div>
            </div>
            <div class="nav">
                <div class="first-nav">
                    <h1 class="ui-logo">
                        <span class="ico-logo1"></span>
                    </h1>
                    <ul class="first-menu">
                        @for (int i = 0; i < authKeys.Length; i++)
                        {
                            if (authKeys[i] == this.ViewBag.Nav)
                            {
                                <li class="mainitem-selected"><a href="javascript:void(0)" id="@authKeys[i]">@authValues[i]</a></li>
                            }
                            else
                            {
                                <li><a href="@mainNavUrls[i]" id="@authKeys[i]">@authValues[i]</a></li>
                            }
                        }
                    </ul>
                </div>
                <div class="second-nav">
                    <form class="searchForm">
                        <input type="text" name="search" id="search" placeholder="客人/手机/订单号" />
                        <div style="background:#b5b5b5; float:right;width: 24px;height: 24px;"><input type="submit" value=""></div>
                    </form>
                    <ul class="second-menu">

                        @if (this.ViewBag.Nav == Constants.SettingsManagement)
                        {
                            var settingsMenuKeys = new string[] { Constants.AccountManagement, Constants.PaymentManagement, Constants.PersonalManagement };
                            var settingsMenuValues = new string[] { "帐号管理", "支付方式管理", "个性化设置" };
                            var settingsMenuUrls = new string[] { "settings/account", "settings/payment", "settings/personal" };

                            for (int i = 0; i < settingsMenuKeys.Length; i++)
                            {
                                if (this.ViewBag.SubNav == settingsMenuKeys[i])
                                {
                                    <li class="seconditem-selected"><a href="@settingsMenuUrls[i]" id="@settingsMenuKeys[i]">@settingsMenuValues[i]</a></li>
                                }
                                else
                                {
                                    <li><a href="@settingsMenuUrls[i]" id="@settingsMenuKeys[i]">@settingsMenuValues[i]</a></li>
                                }
                            }
                        }

                        @if (this.ViewBag.Nav == Constants.RoomInfoManagement)
                        {
                            var roomTypeMenuKeys = new string[] { Constants.RoomTypeManagement, Constants.RoomPriceManagement };
                            var roomTypeMenuValues = new string[] { "房型设置", "房价设置" };
                            var roomTypeMenuUrls = new string[] { "roomtype/catalog", "roomtype/dailyprice" };

                            for (int i = 0; i < roomTypeMenuKeys.Length; i++)
                            {
                                if (this.ViewBag.SubNav == roomTypeMenuKeys[i])
                                {
                                    <li class="seconditem-selected"><a href="@roomTypeMenuUrls[i]" id="@roomTypeMenuKeys[i]">@roomTypeMenuValues[i]</a></li>
                                }
                                else
                                {
                                    <li><a href="@roomTypeMenuUrls[i]" id="@roomTypeMenuKeys[i]">@roomTypeMenuValues[i]</a></li>
                                }
                            }
                        }
                    </ul>

                </div>
            </div>
        </div>
        @RenderBody()

    </div>

</body>
</html>
